package com.example.demo.test1.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.test1.entity.Account;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author cys1731 2020/4/23 16:55
 */
@Mapper
@Repository
public interface AccountMapper extends BaseMapper<Account> {
    /**
     * 获取所有有效的类型
     */
    ArrayList<String> listTypeName();

    /**
     * 查询 类型，类型汇总 by 年份，计费组织
     */
    ArrayList<LinkedHashMap<String, Object>> listTypeCostByYearGroup(int year, String accountGroupId);

    /**
     * 查询 类型，类型汇总 by 年份，月份，计费组织
     */
    ArrayList<LinkedHashMap<String, Object>> listTypeCostByYearMonthGroup(int year, int month, String accountGroupId);

    /**
     * 查询前5 类型，类型汇总 by 年份，计费组织
     */
    ArrayList<LinkedHashMap<String, Object>> listTypeCostTop5ByYearGroup(int year, String accountGroupId);

    /**
     * 查询 月，类型，月类型汇总 by 年份，计费组织
     */
    ArrayList<Map<String, Object>> listMonthTypeCostByYearGroup(int year, String accountGroupId);
}
